package com.cuotibao.zhuoxiao.basics.utils;

import android.content.SharedPreferences;
import android.util.Log;

import com.cuotibao.zhuoxiao.basics.BaseApplication;
import com.cuotibao.zhuoxiao.basics.GlobalConstant;

/**
 * @author hdx on 2019/4/25.
 */
public class IpUtils {
    public static int IpIndex;

    static {
        IpIndex = getIpIndex();
    }

    public static final String[] Ips = new String[]{
            "http://www.jiluxuexi.com:8099",//正式环境
            "http://106.13.120.19:8099",//百度
            "http://101.132.156.91:8096",//测试
            "http://192.168.0.115:8096",//张攀测试
            "http://192.168.0.105:8096"//檀工测试
    };

    public static int getIpIndex() {
        SharedPreferences spDebugMode = BaseApplication.getIns().getSharedPreferences("debug_mode", 0);
        int index = spDebugMode.getInt(GlobalConstant.KEY_DEBUG_INDEX, 0);
        return index;
    }

    public static String getOrganizationUrl() {
        return BaseApplication.getIns().getOrganizationUrl();
    }

    public static String getImageUrl(String partUrl) {
        return getOrganizationUrl()+partUrl;
    }

}
